package cn.edu.scnu.entity;

import lombok.Data;

@Data
public class Return {
    private String msg;
    private Object data;
    private boolean flag;

    public Return() {
    }
    public Return(String msg, boolean flag) {
        this.msg = msg;
        this.flag = flag;
    }
    public Return(String msg, Object data, boolean flag) {
        this.msg = msg;
        this.data = data;
        this.flag = flag;
    }

    public Return sussess(Object data){
        this.msg="操作成功";
        this.flag = true;
        this.data = data;
        return this;
    }
    public Return error(String msg){
        this.msg = msg;
        this.flag = false;
        this.data = null;
        return this;
    }
}
